/**
*
* @author
*
*/
class OpPageXiazai extends OpPage {

    private _bgSprite: egret.Bitmap;
    private _touchEnabled: Boolean = false;

    public constructor() {
        super();

        this._bgSprite = new egret.Bitmap();
        this._bgSprite.texture = RES.getRes('page/op-xiazai.jpg');
        this._bgSprite.width = 1200;
        this._bgSprite.height = 750;
        this._bgSprite.x = 0;
        this._bgSprite.y = 0;
        this.addChild(this._bgSprite);
    }

    public enableTouch(): void {
        this._touchEnabled = true;
    }

    public oneTouch(event: egret.TouchEvent): void {
        if(event.stageX > 140 && event.stageX < 570 &&
            event.stageY > 490 && event.stageY < 640) {
            if(this._touchEnabled) {
                this._touchEnabled = false;
                EventBus.trigger('OP_PLAY_NEXT');
            }
        } else if(event.stageX > 595 && event.stageX < 1025 &&
            event.stageY > 490 && event.stageY < 640) {
            if(this._touchEnabled) {
                window.location.href = 'http://www.baidu.com';
            }
        } else {
            // Do nothing
        }
    }
}

